package com.xiaoye.qbproject.config;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author : ChenYao
 * @version : 1.0
 * @description :
 * @create : 2024-12-25 17:26
 */
@Configuration
public class MybatisPlusConfig {
    @Bean
    public MybatisPlusInterceptor getMybatisPlusInterceptor() {
        MybatisPlusInterceptor mpi = new MybatisPlusInterceptor();
        PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor();
        //分页的数据库类型，设置为达梦
        paginationInnerInterceptor.setDbType(DbType.DM);
        mpi.addInnerInterceptor(paginationInnerInterceptor);
        return mpi;
    }
}